package org.poem.exception;

import lombok.Getter;
import lombok.Setter;
import org.poem.exception.enums.KeeperEnums;

/**
 * 异常处理
 */
@Setter
@Getter
public class ZkRegisterException extends Exception {
    private String message;
    private String code;

    public ZkRegisterException(String message) {
        super(message);
        this.message = message;
    }

    public ZkRegisterException(KeeperEnums enums) {
        super(enums.getName());
        this.message = enums.getName();
        this.code = enums.getCode();
    }

    public ZkRegisterException(KeeperEnums enums,String message) {
        super(message);
        this.message = message;
        this.code = enums.getCode();
    }

    public ZkRegisterException(String message,String code) {
        super(message);
        this.message = message;
        this.code = code;
    }
}
